import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpVipCard {
  id!: number;
  title!: string;
  type!: boolean;
  day?: number;
  price!: string;
  sort: number = 0;
  state: boolean = true;
  uniacid!: number;
}

export const ImsYzdKpVipCardSchema = new EntitySchema({
  class: ImsYzdKpVipCard,
  properties: {
    id: { primary: true, type: 'number' },
    title: { type: 'string', length: 255 },
    type: { type: 'boolean' },
    day: { type: 'number', nullable: true },
    price: { type: 'string', columnType: 'numeric(10,2)' },
    sort: { type: 'number', default: 0 },
    state: { type: 'boolean', default: true, index: 'state' },
    uniacid: { type: 'number', index: 'uniacid' },
  },
});
